package routers

import (
	"github.com/gin-gonic/gin"
	"shortUrl/controllers"
	"shortUrl/middleware"
)

func Init(r *gin.Engine, ctrl *controllers.ContraollerUrl) {
	r.Use(middleware.Cors())
	v1 := r.Group("/api")

	{
		v1.POST("/createUrl", ctrl.CreateUrl)
	}
	r.GET("/:shortCode", ctrl.RedirectUrl)
}
